Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add column filters component #821

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

p0psicles
Copy link
Collaborator

@p0psicles p0psicles commented Feb 28, 2021

Use a column filter by using the vgt option: :column-filter-options="{ enabled: true }"

column-filters

* Add slots:
 - table-actions-header
 - table-actions-global-search
 - table-actions-dropdown
background-color: red;
}

#vgt-root >>> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried applying a little example styling. But it won't work.
I'm not used to using scss, so maybe I foobar'd there?

@p0psicles
Copy link
Collaborator Author

@xaksis can I get some feedback on this one?

@xaksis
Copy link
Owner

xaksis commented Mar 3, 2021

hey @p0psicles. Yeah, I've looked this over but I'm trying to think about how we can make this an optional include. Basically, create an infrastructure for table plugins. (I know I've discussed this in the past) This is a prefect use-case for it. I haven't had a chance to explore it in detail yet though... would be happy to get some help.

@p0psicles
Copy link
Collaborator Author

Ohh I've also never done anything like this. Wouldn't know where to start tbh

@xaksis
Copy link
Owner

xaksis commented Mar 3, 2021

Ha! I'm in the same boat. I'm taking the next week off (after a LOOONG time) will try and come up with something.

@p0psicles
Copy link
Collaborator Author

IMO it's already an optional component. the UI component is a separate vue component. Which can be optionally used.

Would you want to create and maintain separate plugin repo's for plugins? Like have a user need to do yarn add vgt-plugin-column-filter?

@xaksis
Copy link
Owner

xaksis commented Mar 3, 2021

I wouldn't. You would! The idea is to democratize the eco-system around the table. So people can make/maintain their own extensions, with the base being a lean VGT with core functionalities. That'd be a decent way to scale, without one person becoming the bottleneck for multiple extensions. What do you think?

@p0psicles
Copy link
Collaborator Author

Yeah sounds nice. Little bit idealistic. I think we'd need to start to start with an existing feature and flesh that out. And preferably have vgt offer an api that can be used by the plugin. But again. No idea how. But I'm always up for learning new stuff.

Plus I really need a number of features. As running my fork is a pita. As I need to rebase and resolve conflicts with each release.

@p0psicles
Copy link
Collaborator Author

Doing some thinking. Maybe vue 3 composition api could help here.

@p0psicles
Copy link
Collaborator Author

@xaksis I'm giving it a go using scoped slots.
I'll push the changes in this pr

@@ -0,0 +1,53 @@
<template>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xaksis I think this is the best we can do to separate features from the core functionality.
My idea was to create a plugins folder, and add some "example" components there, and expose these to the user.
We could create cookbook section in de docs, that explains this.

Imo I think we should gradually move some of the components to the plugins folder. So the user can use those, extend from it. Or drop in something entirely different.

If you want to move to something that's for ex renderless, that's possible. But that would require a total rewrite. And imo I think Vue3's composition API could shine there. Abstracting out render related functions.

I think you can decrease maintenance costs, by utilizing scoped slots more, and having some example components in plugins. That way, you could put the MVP in plugins, while offering a lot of flexibility to the user.

@@ -37,11 +41,17 @@
{{props.formattedRow[props.column.field]}}
</span>
</template> -->

<template v-slot:table-actions-dropdown="{columns}">
Copy link
Collaborator Author

@p0psicles p0psicles Mar 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three lines to utilize the column filter, but a user can drop-in his own component if he likes.

@p0psicles
Copy link
Collaborator Author

@xaksis if you could give me some feedback I'm willing to do some work on this

@xaksis
Copy link
Owner

xaksis commented Mar 12, 2021

This requires more thinking through. I will update here when I have some time to work through it.

@p0psicles
Copy link
Collaborator Author

Sure. tnx for the update

@p0psicles
Copy link
Collaborator Author

It has been a few weeks. Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants